POV-Ray : Newsgroups : povray.newusers : Turn an arrow : Re: Turn an arrow Server Time
29 Jul 2024 16:30:55 EDT (-0400)
  Re: Turn an arrow  
From: Oleguer Vilella
Date: 1 Aug 2005 05:25:48
Message: <42edea9c@news.povray.org>
Hi Slime and all,

Using your code like this:
======================================
#declare H = 2;
#declare X = 90;
#declare R = .2;

#declare Fletxa = object {
intersection {
torus {
// we want X/360 * circumference of torus to equal H
#declare MajorRad = H*360/(X*2*pi);
MajorRad,
// minor radius = cylinder's radius
R }
#if (X < 180)
intersection {
#else

union {
#end
// cut off the bottom
plane { -z, 0 }
// cut off the other end
plane { z, 0
rotate X*y } }

translate MajorRad*x
rotate -90*x
pigment { rgb 1 }
rotate 90*x
translate <0, 0, 0> + Direction
}}

#declare Punta = object {
cone { <0,0,0>,0.5,<1.5,0,0>,0
pigment { rgb 1 } }
scale 0.5
translate <0, 6, 0> + Direction
}

union {
object { Fletxa }
object { Punta rotate <0, 90, 0> } }
======================================
How can I calculate the position of the cone the place it exactly on the end 
of the torus?

Regards,
Oleguer



news:42ebcc73@news.povray.org...
> Hi all,
>
> Yeah, you've used a torus to do it.
>
> Sorry for the late reply, I was outside of Lleida.
>
> Thanks,
> Oleguer
>
>
>
>

> news:42e2ca2c$1@news.povray.org...
>>> But, should be a way to turn the cylinder like a half torus and I don't
>> know
>>> how can I do it.
>>
>> I'm not quite sure what you're asking if my reply didn't answer it.
>>
>> Let's say you had a cylinder, along the Y axis from <0,0,0> to <0,H,0> 
>> with
>> radius R. You want to curl the cylinder by X degrees towards the x-axis. 
>> You
>> could do it like this:
>>
>> #declare H = 2;
>> #declare X = 90;
>> #declare R = .2;
>>
>> intersection {
>>    torus {
>>        // we want X/360 * circumference of torus to equal H
>>        #declare MajorRad = H*360/(X*2*pi);
>>        MajorRad,
>>        // minor radius = cylinder's radius
>>        R
>>
>>    }
>>
>>    #if (X < 180)
>>        intersection {
>>    #else
>>        union {
>>    #end
>>        // cut off the bottom
>>        plane {
>>            -z,0
>>        }
>>        // cut off the other end
>>        plane {
>>            z,0
>>            rotate X*y
>>        }
>>    }
>>
>>    translate MajorRad*x
>>    rotate -90*x
>>
>>    pigment {rgb 1}
>>
>>    rotate 90*x
>> }
>>
>> It sounds like you want X = 180 if you want "half a torus." Watch what
>> happens as you bring X from 0 to 90, 180 and even up to 360.
>>
>> - Slime
>> [ http://www.slimeland.com/ ]
>>
>>
>
>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.